package com.wzz.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author DarkClown
 * @date 2024-08-05 10:21
 * @project_name day0805-week3
 * @parem
 **/
@Configuration
public class MQConfig {
    @Bean
    public Queue addQueue1(){
        return new Queue("addQueue1",true);
    }
    @Bean
    public Queue addQueue2(){
        return new Queue("addQueue2",true);
    }

    @Bean
    public DirectExchange directExchange(){
        return new DirectExchange("addExchange");
    }

    @Bean
    public Binding addBinDing1(){
        return BindingBuilder.bind(addQueue1()).to(directExchange()).with("");
    }
    @Bean
    public Binding addBinDing2(){
        return BindingBuilder.bind(addQueue2()).to(directExchange()).with("");
    }

}
